@echo off  

set old_ip=NULL

:loop


for /f %%u in ('curl -s "https://ipv4.icanhazip.com/"') do (
	set cur_ip=%%u
)
echo %date:~0,10% %time:~0,8%   IP: %cur_ip%

if %old_ip% EQU NULL (
	set old_ip=%cur_ip%
) else if %old_ip% NEQ %cur_ip% (
	echo 外网IP地址变动,执行:
	taskkill /im notepad.exe
	start notepad
	set old_ip=%cur_ip%
)


Wscript sleep.vbs 10000
goto loop